timen += interval ) {
waypoint *wpt_new = waypt_dupe(wpt);
wpt_new->creation_time = timen;
- xfree(wpt_new->shortname);
- if (wpt_new->description) {
- xfree(wpt_new->description);
- wpt_new->description = NULL;
- }
- wpt_new->shortname = wpt_new->description = 0;
+ if (wpt_new->shortname) xfree(wpt_new->shortname);
+ if (wpt_new->description) xfree(wpt_new->description);
+ wpt_new->shortname = wpt_new->description = NULL;
linepart( lat1, lon1,
wpt->latitude, wpt->longitude,
(double)(timen-time1)/
waypoint *wpt_new = waypt_dupe(wpt);
wpt_new->creation_time = distn/curdist*
(wpt->creation_time - time1) + time1;
- xfree(wpt_new->shortname);
- if (wpt_new->description) {
- xfree(wpt_new->description);
- wpt_new->description = NULL;
- }
- wpt_new->shortname = wpt_new->description = 0;
+ if (wpt_new->shortname) xfree(wpt_new->shortname);
+ if (wpt_new->description) xfree(wpt_new->description);
+ wpt_new->shortname = wpt_new->description = NULL;
linepart( lat1, lon1,
wpt->latitude, wpt->longitude,
distn/curdist,